package com.hopu.emp_demo.service.impl;

import com.hopu.emp_demo.dao.DepartmentDAO;
import com.hopu.emp_demo.entity.Department;
import com.hopu.emp_demo.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    DepartmentDAO departmentDAO;

    @Override
    public Department findById(Long id) {
        return departmentDAO.selectById(id);
    }

    @Override
    public List<Department> findAll() {
        return departmentDAO.selectAll();
    }
}
